/**
 * ClassName ArrayIndexOutOfBoundsExceptionTest
 * Description TODO
 * Author Hexiao
 * Date 2018/8/22 15:45
 * Version 1.0
 **/
public class ArrayIndexOutOfBoundsExceptionTest {
    public static void main(String[] args) {
        String[] departments = new String[] {"人资行政部", "财务部", "新产品部", "增值业务部"};
//        System.out.println(Integer.MAX_VALUE);//2147483647
        try {
            for(int i = 0; i < Integer.MAX_VALUE; i++) {
                System.out.println(departments[i]);//数组下标越界
            }
        }catch (ArrayIndexOutOfBoundsException e){
            System.out.println("数组下标越界");
        }

    }

}